package com.huan.dao.mapper;


import com.huan.pojo.Teacher;
import org.apache.ibatis.annotations.*;
import java.util.List;

public interface TeacherMapper {
    /**
     * 查询总记录数
     * @return
     */
    @Select("select count(*) from 教师情况")
    int selectTotalCount();


    /**
     * 分页条件查询
     * @param begin
     * @param size
     * @return
     */
    List<Teacher> selectByPageAndCondition(@Param("begin") int begin, @Param("size") int size, @Param("teacher") Teacher teacher);

    /**
     * 根据条件查询总记录数
     * @return
     */
    int selectTotalCountByCondition(Teacher teacher);

    /**
     * 增加
     * @param teacher
     */
    @Insert("insert into 教师情况 values(#{teacherID},#{name},#{sex},#{pro},#{departmentID})")
    boolean add(Teacher teacher);

    /**
     * 编辑
     * @param teacher
     */
    @Update("update 教师情况 set name = #{name},sex = #{sex},pro = #{pro} where teacherID = #{teacherID}")
    int update(Teacher teacher);

    /**
     *删除
     * @param teacherID
     */
    @Delete("delete from 教师情况 where teacherID = #{teacherID}")
    void delete(String teacherID);

    /**
     * 批量删除
     * @param ids
     */
    void deleteByIds(@Param("ids") String[] ids);
}
